package com.jin.spirng_boot_learn.generalErase;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class runGeneralErase {

    public static void main(String[] args) {
        Class fanClass = new FanDemo<FanDto<String>>(){}.getClass(); //实例化 匿名子类
        ParameterizedType genericSuperclass = (ParameterizedType)fanClass.getGenericSuperclass(); // 通过匿名子类获取 泛型父类
        Type[] types = genericSuperclass.getActualTypeArguments();
        for (Type type : types) {
            System.out.println(((ParameterizedType)type).getTypeName());
        }
    }
}
